package com.matt.controller.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.matt.domain.article.Article;
import com.matt.commons.model.StatusResponse;
import com.matt.service.ArticleService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(tags ="文件管理")
@RestController
@RequestMapping("/web/article")
public class WebArticleController {
	 @Autowired
	 private ArticleService articleService;
	 
	 @ApiOperation(value = "(新)获取文件列表信息",httpMethod = "POST")
	 @ApiImplicitParams({
	    	@ApiImplicitParam(paramType = "query", name = "typeId", value = "类型Id", required = true, dataType = "int"),
		
	    })
	 @RequestMapping(value = "/getArticleByTypeId")
	 public StatusResponse getAtricleByTypeId(Integer typeId) {
	     List<Article> articleList = articleService.getAtticleByTypeId(typeId);
	     return StatusResponse.success(articleList);
	 }
	 
	 @RequestMapping(value = "/getArticleById")
	 public StatusResponse getAtricleByTypeId(String id) {
	     Article article = articleService.getAtticleById(id);
	     return StatusResponse.success(article);
	 }
}
